import mainRouter from "./mainRouter";
import store from '@/store';

const routerConfig = [
  {
    path: '/',
    redirect: '/main'
  },
  {
    path: '/login',
    component: () => import('../views/Login')
  },
  {
    path: '/main',
    component: () => import('../views/Main'),
    children: mainRouter
  }
];

export const getAsideData = () => {
  // console.log(store.state.permission.routes);
  return store.state.permission.routes[2].children.filter(item => item.meta)
    .filter(item => item.meta.title).map(item => {
      return {
        toPath: `${routerConfig[2].path}/${item.path}`,//  /main/gridview
        title: item.meta.title
      }
    })
};

export default routerConfig
